<?php
$loader->requireOnce('includes/LabConnector/LabComponentConnector.class.php');
/**
 * 
 * @package include
 * @author viethd
 * @version $Id$
 * @copyright 2009 LHV Company
 */
class LabAssignmentConnector extends LabComponentConnector {
	const ASSIGNMENT_PATH = 'C_LabAssignment';	
	function __construct() {
		parent::__construct();		
	}
	/**
	 * Render assignment page for make laboratory assignment.
	 * @return html
	 */
	public function renderAssignmentPage($ticketId, $idOfActionAfterCreating) {
		$assignmentController = $this->hisLoader->getObj(LabAssignmentConnector::ASSIGNMENT_PATH);
		return $assignmentController->renderAssignmentPage($ticketId, $idOfActionAfterCreating);		
	}
    /**
     * Render assignment page for make laboratory assignment.
     * @return html
     */
    public function renderAssignmentPage4VEdit($ticketId, $labAssignmentTicketId, $idOfActionAfterUpdating) {
        $assignmentController = $this->hisLoader->getObj(LabAssignmentConnector::ASSIGNMENT_PATH);
        return $assignmentController->renderAssignmentPage4VEdit($ticketId, $labAssignmentTicketId, $idOfActionAfterUpdating);        
    }
	/**
     * List lab assignment of givent ticketId.
     * @param $ticketId
     * @return array[n](lab_assignment_ticket_id, request_time, diagnosis,
     * <br>
     *  PE.name treatment_doctor_name, treatment_doctor_id, enum_status, enum_status_text)
     */
	public function listAssignments($ticketId) {
		$assignmentController = $this->hisLoader->getObj(LabAssignmentConnector::ASSIGNMENT_PATH);
        return $assignmentController->listAssignments($ticketId);		
	}
	/**
	 * delete a given lab assignment.
	 * @param $labAssignmentTicketId
	 * @return unknown_type
	 */
    public function deleteAssignment($labAssignmentTicketId) {
        $assignmentController = $this->hisLoader->getObj(LabAssignmentConnector::ASSIGNMENT_PATH);
        return $assignmentController->deleteAssignment($labAssignmentTicketId);       
    }
    
    /**
     * delete a given lab assignment.
     * @param $labAssignmentTicketId
     * @return unknown_type
     */
    public function deleteAssignmentOfGivenTicketId($ticketId) {
        $assignmentController = $this->hisLoader->getObj(LabAssignmentConnector::ASSIGNMENT_PATH);
        return $assignmentController->deleteAssignmentOfGivenTicketId($ticketId);       
    }
    
     /**
     * add assignment into lab queue
     * @param $labAssignmentTicketId
     * @return unknown_type
     */
    public function startAssignment($labAssignmentTicketId) {
        $assignmentController = $this->hisLoader->getObj(LabAssignmentConnector::ASSIGNMENT_PATH);
        return $assignmentController->startAssignment($labAssignmentTicketId);       
    }
    
    public function renderLabAssignment4Print($labAssignmentTicketId) {
    	$assignmentController = $this->hisLoader->getObj(LabAssignmentConnector::ASSIGNMENT_PATH);
        return $assignmentController->actionPrintAssignment($labAssignmentTicketId);    	
    }
    
    
}
?>